import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入移动端适配插件
import 'amfe-flexible'
// 引入vant组件库
import { NavBar, Field, Form, Button, Tabbar, TabbarItem, icon, CellGroup, Search, Tab, Tabs, Cell, Image as VanImage, Grid, GridItem } from 'vant'

import { allChannelListAPI } from '@/api'

Vue.use(Grid)
Vue.use(GridItem)
Vue.use(VanImage)
Vue.use(Cell)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Search)
Vue.use(CellGroup)
Vue.use(icon)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Button)
Vue.use(Form)
Vue.use(Field)
Vue.use(NavBar)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

const myFn = async () => {
  try {
    await allChannelListAPI()
  } catch (err) {
    console.error(err.message)
  }
}
myFn()
